home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb14.zip / SIGNORM.PAS < prev    next >
Pascal/Delphi Source File  |  1985-05-17  |  2KB  |  40 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*              SigNorm  -- Significance of normal distribution            *)
  3. (*-------------------------------------------------------------------------*)
  4.  
  5. FUNCTION SigNorm( X : REAL ) : REAL;
  6.  
  7. (*-------------------------------------------------------------------------*)
  8. (*                                                                         *)
  9. (*       Function:  SigNorm                                                *)
  10. (*                                                                         *)
  11. (*       Purpose:   Evaluates normal distribution probability              *)
  12. (*                                                                         *)
  13. (*       Calling Sequence:                                                 *)
  14. (*                                                                         *)
  15. (*            P     := SigNorm( X );                                       *)
  16. (*                                                                         *)
  17. (*                 X      --- ordinate of normal distribution              *)
  18. (*                                                                         *)
  19. (*                 P      --- Resultant tail probability                   *)
  20. (*                                                                         *)
  21. (*       Calls:                                                            *)
  22. (*                                                                         *)
  23. (*            Erf                                                          *)
  24. (*                                                                         *)
  25. (*       Method:                                                           *)
  26. (*                                                                         *)
  27. (*            The simple relationship between the error function and the   *)
  28. (*            normal distribution is used.                                 *)
  29. (*                                                                         *)
  30. (*-------------------------------------------------------------------------*)
  31.  
  32. BEGIN (* SigNorm *)
  33.  
  34.    IF X >= 0.0 THEN
  35.       SigNorm := 1.0 - ( 1.0 + Erf(  X / Sqrt2 ) ) / 2.0
  36.    ELSE
  37.       SigNorm := 1.0 - ( 1.0 - Erf( -X / Sqrt2 ) ) / 2.0;
  38.  
  39. END   (* SigNorm *);
  40.